Repository navigation
perf(agc): keep the cached address space for a read-only V# across two imports - #5428
Conversation
|
Two things before this can go in:
|
…o imports Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ad05918 to
972ce12
Compare
|
Rebased onto main to resolve the conflict in |
…s a read-only V# copied across imports A read-only V# that crosses two base regions is copied per build while the space stays. A written V# overlapping that copy would bind the base region's import while the read-only V# binds the copy of the same bytes. Dissolve the space in that case (either order of the two), as without this branch, so both share the one merged region.
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
|
… copied read-only range
|
@oneandonlydean thanks for e5d6556 and fd2c300, the dissolve for a written V# over the copied read-only range and its test. That covers the coherence point. On the numbers: I can't take a It stops the same way with #5573 on top. My earlier numbers came from a local stack that skips draws which throw, which is why the description doesn't present them as |
|
Pushed two commits on top so this can go in. If a written V# overlaps a read-only V# that is copied across two imports, the space now dissolves, in either order of the two, as it does on One run of This closes our earlier ask. |
|
Resident Evil Village (PPSA01556) stops on this change's path at the title: Since this PR, a read-only V# that partly overlaps the cached space's base gets a region of its own, so a build's own regions can overlap base regions. Setup for the stop: |
Why
Kena: Bridge of Spirits (PPSA01802, UE4) spends most of its driver time rebuilding the resources of address-based draws once its first level loads. Most of those builds hit the cached address space, but about 70% of them then dissolve it. A read-only V# crosses the boundary between two adjacent registered ranges that are imported separately, for example
0x20163a0000+0x240000over0x20163a0000-0x20165c0000and0x20165c0000-0x2016650000.addDescriptorRegionsees a partial overlap with the space and callsdissolveSpace, which merges all of the space's ranges (about 9,000 in that scene) into the build.UploadPreparethen sorts and merges them, andUploadFinishandAddressRangeswalk them, on every such draw.What
AddReadable) that partially overlaps the space's ranges no longer dissolves the space, unless one of the overlapped ranges is an image mirror. The region is added to the build's own regions and copied, as it was after a dissolve. Its BDA table entry is read-only, as the merged copied region's was.Tested
Linux (Arch, kernel 7.2), RADV RX 9070 XT, Release.
spaceReadAcrossImportsTestsinagc_driver_graphics: three 64 KiB ranges with a 128 KiB import window give two imports. A read-only V# across their boundary must bind the bytes of both ranges, keep both imports in the BDA table, and, on the second build, hit the cached space without a dissolve. It passes with the change. Without it, it fails witha read-only V# across two imports dissolved the cached address space.ctest: 1070 of 1071 pass.agc_driver_tessellationsegfaults on this machine on plainmainas well.mainagainst this branch alone, and no trace attached; I can capture them on request. The comparison switched this change off together with a second local change (reusing draws whose read-only buffers were copied), so the numbers below are for both. Address-space dissolves drop from about 38 to 0 per 10 s, and the average number of regions in an address-based build from 225 to 3; those two come from this change.Graphics::Drawdrops from 683 to 390 us per draw packet. Presents go from 10-21 to 81-89 per 10 s in the middle of the run, and from about 19 to 33-41 in the heaviest part.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code